*Table A.36: Meal and Snack treatment effects on “Added Sugar” - alternative samples and estimation techniques
cd ""

use temp_before_balanced_analysis_nmesg, clear

ge t=session
replace t=t-1 if session>2
ta t
keep if child==1
sort id_nb t
by id_nb: generate n2 = _N

xtset id_nb t

ge x=t==5
egen lastsession=max(x), by(id_nb)


*Baseline FE
xtreg nmesg session3 session4 session5 session6 meal_session3 meal_session4 meal_session5 meal_session6 snack_session3 snack_session4 snack_session5 snack_session6 if child==1, cluster(hh_id) fe

*Balanced FE
xtreg nmesg session3 session4 session5 session6 meal_session3 meal_session4 meal_session5 meal_session6 snack_session3 snack_session4 snack_session5 snack_session6 if child==1 & n2==5, cluster(hh_id) fe

*Balanced RE
xtreg nmesg session3 session4 session5 session6 meal_session3 meal_session4 meal_session5 meal_session6 snack_session3 snack_session4 snack_session5 snack_session6 if child==1 & n2==5, cluster(hh_id) re

*Year 3 FE
xtreg nmesg session3 session4 session5 session6 meal_session3 meal_session4 meal_session5 meal_session6 snack_session3 snack_session4 snack_session5 snack_session6 if child==1 & lastsession==1, cluster(hh_id) fe

*Baseline OLS
reg nmesg session3 session4 session5 session6 meal_session3 meal_session4 meal_session5 meal_session6 snack_session3 snack_session4 snack_session5 snack_session6 if child==1, cluster(hh_id)
